home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / rdflib / sparql / bison / SolutionModifier.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  2.1 KB  |  48 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. ASCENDING_ORDER = 1
  5. DESCENDING_ORDER = 2
  6. UNSPECIFIED_ORDER = 3
  7. ORDER_VALUE_MAPPING = {
  8.     ASCENDING_ORDER: 'Ascending',
  9.     DESCENDING_ORDER: 'Descending',
  10.     UNSPECIFIED_ORDER: 'Default' }
  11.  
  12. class SolutionModifier(object):
  13.     
  14.     def __init__(self, orderClause = None, limitClause = None, offsetClause = None):
  15.         self.orderClause = orderClause
  16.         self.limitClause = limitClause
  17.         self.offsetClause = offsetClause
  18.  
  19.     
  20.     def __repr__(self):
  21.         if not self.orderClause and self.limitClause or self.offsetClause:
  22.             return ''
  23.         if not self.orderClause or ' ORDER BY %s' % self.orderClause:
  24.             pass
  25.         if not self.limitClause or ' LIMIT %s' % self.limitClause:
  26.             pass
  27.         if not self.offsetClause or ' OFFSET %s' % self.offsetClause:
  28.             pass
  29.         return '<SoutionModifier:%s%s%s>' % ('', '', '')
  30.  
  31.  
  32.  
  33. class ParsedOrderConditionExpression(object):
  34.     """
  35.     A list of OrderConditions
  36.     OrderCondition ::= (('ASC'|'DESC')BrackettedExpression )|(FunctionCall|Var|BrackettedExpression)
  37.     """
  38.     
  39.     def __init__(self, expression, order):
  40.         self.expression = expression
  41.         self.order = order
  42.  
  43.     
  44.     def __repr__(self):
  45.         return '%s(%s)' % (ORDER_VALUE_MAPPING[self.order], self.expression.reduce())
  46.  
  47.  
  48.